package liquibase.database.core;

import liquibase.database.DatabaseConnection;
import liquibase.exception.DatabaseException;

/**
 */
public class ZenithDatabase extends OracleDatabase {

    public static final String PRODUCT_NAME = "zenith";

    public ZenithDatabase() {
        super();
    }

    @Override
    public String getShortName() {
        return "zenith";
    }

    @Override
    protected String getDefaultDatabaseProductName() {
        return "Zenith";
    }

    @Override
    public Integer getDefaultPort() {
        return 1888;
    }

    @Override
    public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException {
        return PRODUCT_NAME.equalsIgnoreCase(conn.getDatabaseProductName());
    }


    @Override
    public String getDefaultDriver(String url) {
        if (url.startsWith("jdbc:zenith")) {
            return "com.huawei.gauss.jdbc.ZenithDriver";
        }
        return null;
    }
}
